package study;

import java.util.LinkedList;
import java.util.Queue;
import java.util.concurrent.LinkedBlockingDeque;

/**
 * @version 1.0
 * @since:
 * @ClassName:QueueTest
 * @author: Li Jiahui
 * @date: 2021-04-25 16:55
 */
public class QueueTest {
    public static void main(String[] args) {
        //1.准备一个Queue集合并打印
        Queue qu1 = new LinkedList();
        System.out.println("qu1 = " + qu1);
        //将数据11、22、33、44、55依次入队并打印

        for(int i = 1; i<=5 ; i++) {
            boolean b1 = qu1.offer(i * 11);

        }
        System.out.println(qu1);
        //查看队首元素并打印
        System.out.println(qu1.peek());
        int size = qu1.size();
        for( int i =1; i<=size; i++){
            System.out.println("依次出栈的元素是：" + qu1.poll());
        }
    }
}
